<?php

namespace app\mall\ui\table;

use app\mall\enum\FreightTypeEnum;
use app\mall\enum\YesNoEnum;
use suframe\thinkAdmin\ui\table\TableInterface;

/**
 * 运费模板表格
 */
class MallFreightTemplateTable extends TableInterface
{
    public function header()
    {
        return [
            'id' => ['label' => 'ID', 'sort' => true, 'fixed' => 'left', 'width' => 70],
            'name'=> ['label' => '模板名称'],
            'type_text'=> ['label' => '计算方式', 'filter' => FreightTypeEnum::toZhArray(), 'field' => 'type'],
            'enable_text'=> ['label' => '是否启用', 'filter' => YesNoEnum::toZhArray(), 'field' => 'enable'],
        ];
    }

    public function filters()
    {
        return [
            'name' => ['label' => '模板名称', 'type' => 'text'],
        ];
    }
}